box.space._func
-
box.space._func _funcis a system space with function tuples made by box.schema.func.create().Tuples in this space contain the following fields:
- the numeric function id, a number,
- the function name,
- flag,
- a language name (optional): ‘LUA’ (default) or ‘C’.
The
_funcspace does not include the function’s body. You continue to create Lua functions in the usual way, by sayingfunction function_name () ... end, without adding anything in the_funcspace. The_funcspace only exists for storing function tuples so that their names can be used within grant/revoke functions.You can:
- Create a
_functuple with box.schema.func.create(), - Drop a
_functuple with box.schema.func.drop(), - Check whether a
_functuple exists with box.schema.func.exists().
Example:
In the following example, we create a function named ‘f7’, put it into Tarantool’s
_funcspace and grant ‘execute’ privilege for this function to ‘guest’ user.tarantool> function f7() > box.session.uid() > end --- ... tarantool> box.schema.func.create('f7') --- ... tarantool> box.schema.user.grant('guest', 'execute', 'function', 'f7') --- ... tarantool> box.schema.user.revoke('guest', 'execute', 'function', 'f7') --- ...